{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Secant Method"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import numpy as np\n",
        "import matplotlib.pyplot as pt"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Here's a function: (Look here! No derivative.)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "collapsed": false
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "[<matplotlib.lines.Line2D at 0x7fc4f5a2c470>]"
            ]
          },
          "execution_count": 3,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEACAYAAABMEua6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHv5JREFUeJzt3Xl8FeW9x/HPDxQFt5SXigpo6oJaq6ZYqXWpaRWLtC6t\n3uv1esXorcW1BquCS9HbDaxwRWptXbChV60LdtFbF9RLlOLKEgERERRcMEBRKCIaIM/94zkhISbh\n5MycM/Oc832/XvNK5mSY8309wO9MfjPzjDnnEBGR4tAl6QAiIhIfFXURkSKioi4iUkRU1EVEioiK\nuohIEVFRFxEpIlkVdTO728yWmdmcFq/1NLOnzGyBmU02s7L8xRQRkWxke6T+e2BQq9dGAE855/oB\nz2TWRUQkQZbtzUdmVg486pw7OLM+HzjWObfMzHYDap1zB+QrqIiIbFmUnnov59yyzPfLgF4x5BER\nkQhiOVHq/OG+5hsQEUnYVhH+7DIz2805V29muwPL29rIzFTsRURy4Jyzzv6ZKEfqjwDnZL4/B/hL\nexs651K/XH/99YlnKJacIWRUTuVM+5KrbC9p/CPwPLC/mb1rZucCo4GBZrYA+FZmPViLFy9OOkJW\nQsgZQkZQzrgpZzpk1X5xzp3Zzo+OjzGLiIhEpDtKM6qqqpKOkJUQcoaQEZQzbsqZDllfp57zG5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nJp0ez3xc/TIIuBI4xTn3aTubTQf2M7NyM+sGnAE8EneWLLXZVzOzHma2Q+b77YATgHbP+BdAe/2/\nNIzlI8A5me/PwR/1bCbB8cxmfB4BhmSyHQGsatFOKpQt5jSzXmZ+BiQzG4C/eTBNBR3SMZZblIax\nzLz/BGCec25cO5t1fjzzcEb3TWAJMCuz3JZ5fQ/gby22OxF/tnchcHWBzzp/D9+nWgfUA4+3zgjs\njb8CoQ6YW+iM2eZMeiwz798TeBpYAEwGytI0nm2NDzAUGNpim1szP3+VDq6ISjIncHFm7OqA54Ej\nEsj4R2Ap0JD5t3leSseyw5wpGcujgcZMhqZ6eWLU8dQ0ASIiRUR3lIqIFBEVdRGRIqKiLiJSRFTU\nRUSKiIq6iEgRUVEXESkiKuoiIkVERV1EpIj8P8rJF+RaQ07MAAAAAElFTkSuQmCC\n",
            "text/plain": [
              "<matplotlib.figure.Figure at 0x7fc4f5a2c3c8>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "def f(x):\n",
        "    return x**3 - x +1\n",
        "\n",
        "xmesh = np.linspace(-2, 2, 100)\n",
        "pt.ylim([-3, 10])\n",
        "pt.grid()\n",
        "pt.plot(xmesh, f(xmesh))"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "guesses = [2, 1.5]"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Evaluate this cell many times in-place (using Ctrl-Enter)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 30,
      "metadata": {
        "collapsed": false
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "-1.3247179572447458\n"
          ]
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEACAYAAABMEua6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8VFX6x/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EvWO\nHYN//ctd8v/cczBxohJ6QWmmHmVUsiixZt06t2ZeqBB88w1Urep1RNFNM/UokpKWQt0RdelcszPv\nNH5HCV2iWkYGvPqquyF0u3aQlKSEHgyaqUcJ342h323yLq2vaB204x46BFu3wpYtbtuxw9UD797t\n/ty3z90ebP9+t++RI+4/47FjbmZVqJDrjHfGGVCiBBQvDqVKuY/OZcq4rXx5KFfO/Xneea7ndaVK\nbp94q2gQZ948eOIJqFYNkpNd21wJDpU0RoERySN4Yd4LJLZO5OY/31ygYxw9CuvXw4oV7mTU+vXu\nY++OHS7BXnCB284/HypUcAn43HNd4i1d2m3Fi0PRom4rXBisdVf6HT3qEv7vv7tt/37X4zo9HX79\n1f1y8P2i2LnTddfbscP9Yqha1b1v1apw8cV/bNWquV8UElu+/x6eecb9HPbvD3/9q36x56agJY1K\n6hEse8nizHtn5qtkMT0dvvjCNT9avNjNhipVglq1XO/pyy+HGjXgwgtdkvZCerr7dPDDD+4/++bN\nsGkTbNwI27a52VuNGm674gq48kpXFVFSrWyizi+/uPa4w4dD9+6uZLF4ca+jimxK6jEme8ni9HbT\nT1vhkpnpSsD+9z+3pabCdde59cr69d2d1aOpmiAjwyX5b791bVbXrHHbhg3ul9PVV7utZk33S+qC\nCzTji0QHDrgbQA8Y4Dorvvyy+/eT01NSjyHph9JpMbEFpYqVYlyLcbl2WTx61M3CExNh8mS3ft24\nsbtxQP36cOaZYQ48DI4edTP51FS3jJSSAitXupsOX3ON+yRSu7b7s3p13QnHK3v2wLvvuu222+CV\nV9yymvhPST1G+FOymJoKo0e79qOVK8M997jtkks8CDhC7N7tlpiSk90nluXL4eefXaK/7ro/tosv\nju+bEofali0ukY8YAXfd5W5gUUP3ZikQJfUYsDJtJc3HN+fJG5/k6TonNuX67TeXxP/7X5esOnZ0\nWzwn8tP59Vd3Qm75clf/vHy5e6527T+S/PXXu5O0WropOGthwQJ45x1YtMj9XHbvDn/+s9eRRTcl\n9Sj32abP6DC5A+81eY9WV7Q6/vz337u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6Mz7H47fWfgWUMcZUCG+Yfv87enq1hrV2MbAn\nj10iYSz9iRO8H8s0a+3KrMcHgHXA+Sftlu/xDPWaehdgZg7PVwK2Zft6e9ZzkcYCc40xy4wxD3gd\nTC4iYSwrWGt3ZT3eBeT2Q+fFePozPjntk9NkJJT8idMCdbM+hs80xkTifb8iYSz9EVFjaYypivtk\n8dVJL+V7PAt0RakxZg7uo8PJXrDWTs/a50Ugw1o7Lof9Ql5H6U+Mfqhnrd1pjCkHzDHGrM+aAQRN\nEOIMS01qHnG+eEIw1to8rk0I+XjmwN/xOXnWFu5aX3/ebwVQxVp70BjTGJiCW56LNF6PpT8iZiyN\nMaWARODJrBn7Kbuc9HWe41mgpG6tbZjX68aYzri1oNty2eVHoEq2r6vgfgMFzeli9PMYO7P+/MkY\nMxn3ETmoSSgIcYZ8LCHvOLNOSFW01qYZY84DdudyjJCPZw78GZ+T96mc9Vw4nTZOa+3+bI9nGWMG\nG2PKWmt/DVOM/oiEsTytSBlLY0xR4GNgjLV2Sg675Hs8Q1H90gh4FrjbWnsol92WAdWNMVWNMcWA\nNsC0YMfipxzX1YwxJYwxpbMelwTuAHI94x8Gua3/RcJYTgM6ZT3uhJv1nMDD8fRnfKYBHbNiuwnY\nm205KVxOG6cxpoIxrgOSMeYG3MWDkZTQITLG8rQiYSyz3n84sNZaOyCX3fI/niE4o7sR2AIkZ22D\ns54/H/g0236NcWd7NwHPh/ms819x61S/A2nArJNjBKrhKhBWAqvDHaO/cXo9llnvXxaYC2wAZgNl\nImk8cxof4CHgoWz7vJv1egp5VER5GSfwWNbYrQSWADd5EON4YAeQkfWz2SVCxzLPOCNkLG8GMrNi\n8OXLxoGOp9oEiIjEEF1RKiISQ5TURURiiJK6iEgMUVIXEYkhSuoiIjFESV1EJIYoqYuIxBAldRGR\nGPL/piHkgymROi8AAAAASUVORK5CYII=\n",
            "text/plain": [
              "<matplotlib.figure.Figure at 0x7fc4f4fdb6a0>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "\n",
        "# grab last two guesses\n",
        "x = guesses[-1]\n",
        "xbefore = guesses[-2]\n",
        "\n",
        "slope = (f(x)-f(xbefore))/(x-xbefore)\n",
        "\n",
        "# plot approximate function\n",
        "pt.plot(xmesh, f(xmesh))\n",
        "pt.plot(xmesh, f(x) + slope*(xmesh-x))\n",
        "pt.plot(x, f(x), \"o\")\n",
        "pt.plot(xbefore, f(xbefore), \"o\")\n",
        "pt.ylim([-3, 10])\n",
        "pt.axhline(0, color=\"black\")\n",
        "\n",
        "# Compute approximate root\n",
        "xnew = x - f(x) / slope\n",
        "guesses.append(xnew)\n",
        "print(xnew)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": []
    }
  ],
  "metadata": {},
  "nbformat": 4,
  "nbformat_minor": 0
}